/**
 * responseType: 'arraybuffer'
 * @param {ArrayBuffer} codeData 
 */
function getCodeByArrayBuffer (codeData) {
  let url = 'data:image/jpeg;base64,' + btoa(new Uint8Array(codeData).reduce((data, byte) => {
    data + String.fromCharCode(byte)
  }, ''))
  return url
}

/**
 * responseType: 'blob'
 * @param {Blob} data 
 */
function getCodeByBlob (data) {
  return window.URL.createObjectURL(data)
}
